/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package interestcalculator;

import java.util.Scanner;

/**
 *
 * @author TQNINH
 */
public class InterestCalculator {
    
    public InterestCalculator() {
        
    }
    
    public static void main(String[] args) {
        long prAmount = 0;
        float ratef = 0.0f;
        int yr = 0;
        double simpleInterest = 0.0;
        Scanner input = new Scanner(System.in);
        
        System.out.print("Enter the Principal Amount: ");
        prAmount = input.nextLong();
        
        System.out.print("Enter the rate in percentage: ");
        ratef = input.nextFloat();
        
        System.out.print("Enter the duration in year(s): ");
        yr = input.nextInt();
        
        System.out.println("Processing...");
        System.out.println("**********************************************");
        
        Integer year = new Integer(yr);
        Float rate = new Float(ratef);
        Long principal = new Long(prAmount);
        
        simpleInterest = (principal * rate * year) / 100;
        Double si = new Double(simpleInterest);
        
        System.out.println("The Pricipal Amount entered: $" + principal);
        System.out.println("The Rate of Interest entered: " + rate + "%");
        System.out.println("The duration entered: " + year + "year(s)");
        System.out.println("The simple interest computed on the principal amount" +
                "= $" + si);
        
    }
}
